/**
 * 显示或隐藏遮蔽层
 */
interface State {
  aimDom: {
    style?: { [organName: string]: string };
    context?: { value: string };
    faPosition?: { top: number; left: number };
    [organName: string]: any;
  }; //目标DOM节点
  aimPath: {}[]; //目标路径
  aimAttrs: {
    context?: string;
    goto?: { type: string; value: string };
    [organName: string]: any;
  }; //目标属性
  aimBox: {} | null; //目标容器
  aimXY: {} | null; //鼠标与组件的偏移
  componentList: {};
  seniorBoxList: {};
  //为了可以显示margin...
  colorDomStyle: {
    width: string;
    height: string;
    top: string;
    left: string;
    padding: string;
    border: string;
    margin: string;
  };
  judgeColorDom: boolean;
  domStack: {}[]; //存储栈
  domStackNum: number; //存储栈控制下标
  page?: {
    tree: {
      [organName: string]: {};
    };
  };
}

export default function changeJudgeColorDom(state: State) {
  // 显示或隐藏遮蔽层
  state.judgeColorDom = !state.judgeColorDom;
  if (state.judgeColorDom) {
    // 清空遮蔽层位置大小属性
    state.colorDomStyle = {
      width: "", //width-content
      height: "",
      top: "",
      left: "",
      padding: "",
      border: "",
      margin: "",
    };
    // 清空目标属性，重新选择
    state.aimAttrs = {};
  }
}
